package cn.iocoder.yudao.module.forward.dal.mysql.eqr;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.forward.dal.dataobject.eqr.EqrDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.forward.controller.admin.eqr.vo.*;

/**
 * 速报信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface EqrMapper extends BaseMapperX<EqrDO> {

    default PageResult<EqrDO> selectPage(EqrPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EqrDO>()
                .eqIfPresent(EqrDO::getMsgId, reqVO.getMsgId())
                .likeIfPresent(EqrDO::getLocName, reqVO.getLocName())
                .eqIfPresent(EqrDO::getMagnitude, reqVO.getMagnitude())
                .betweenIfPresent(EqrDO::getOriTime, reqVO.getOriTime())
                .eqIfPresent(EqrDO::getForwardStatus, reqVO.getForwardStatus())
                .betweenIfPresent(EqrDO::getForwardTime, reqVO.getForwardTime())
                .eqIfPresent(EqrDO::getSourceId, reqVO.getSourceId())
                .eqIfPresent(EqrDO::getBrokerId, reqVO.getBrokerId())
                .betweenIfPresent(EqrDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EqrDO::getId));
    }

}